import { httpInstance } from '@/utils/request'

interface FetchCasesAPIParams {
  type_id?: string
  keyword?: string
  recommend?: string
  page?: string
  limit?: string
}

interface FetchCasesAPIResData {
  code: number
  data: {
    current_page: number
    data: Case[]
    last_page: number
    per_page: string
    total: number
  }
  msg: string
  time: string
}

export function fetchCasesAPI(params: FetchCasesAPIParams) {
  return httpInstance.get<
    FetchCasesAPIResData,
    FetchCasesAPIParams
  >('api/Case_project/caseList', { params })
}
